import request from "../../utils/request";

/**
 * 获取供应商商品
 * @param {*} obj
 */
export const getSingleSupplierGoods = (obj) => {
  return request({
    url: "api/wechat/GetSingleSupplierGoods",
    params: obj,
    method: "GET",
  });
};


/**
 * 商品上架/下架
 * @param {*} obj
 * @returns
 */
export const goodsShelve = (obj) => {
  return request({
    url: "api/wechat/Supplier_GoodsShelve",
    data: obj,
    method: "POST",
  });
};

/**
 * 补货
 * @returns
 */
export const supplierBuhuo = (obj) => {
  return request({
    url: "api/wechat/buhuo",
    data: obj,
    method: "POST",
  });
};

/**
 * 新增供应商
 */
export const AddGoods = (obj) => {
  return request({
    url: "api/wechat/SupplierAddGoods",
    data: obj,
    method: "POST",
  });
};

/**
 * 获取商品资质
 * @returns
 */
export const getGoodsQualifications = (obj) => {
  return request({
    url: "api/wechat/GetGoodsQualifications",
    params: obj,
    method: "get",
  });
};

/**
 * 新增商品资质
 * @param {*} obj
 * @returns
 */
export const addQualifications = (obj) => {
  return request({
    url: "api/wechat/addQualifications",
    data: obj,
    method: "post",
  });
};

/**
 * 删除商品资质
 * @param {} obj
 * @returns
 */
export const deleteQualifications = (obj) => {
  return request({
    url: "api/wechat/deleteQualifications",
    data: obj,
    method: "post",
  });
};

/**
 * 获取供应商商品
 * @param {*} obj
 */
export const getGoods = (obj) => {
  return request({
    url: "api/wechat/GetSupplierGoods",
    params: obj,
    method: "GET",
  });
};

/**
 * 供应商-更新商品生产日期
 * @param {*} obj
 */
export const updateBirthday = (obj) => {
  return request({
    url: "api/wechat/Supplier_UpdateBirthday",
    data: obj,
    method: "POST",
  });
};

/**
 * 新增类别
 * @param {*} obj
 * @returns
 */
export const addGoodsType = (obj) => {
  return request({
    url: "api/wechat/Supplier_AddGoodsType",
    data: obj,
    method: "POST",
  });
};

/**
 * 获取商品类别
 * @returns
 */
export const getGoodsTypes = (obj) => {
  return request({
    url: "api/wechat/Supplier_GetGoodsTypes",
    params: obj,
    method: "GET",
  });
};

/**
 * 获取供应商的所有类别和类别下商品
 * @returns
 */
export const getTypesAndGoods = (obj) => {
  return request({
    url: "api/wechat/Supplier_GetTypesAndGoods",
    params: obj,
    method: "GET",
  });
};

/**
 * 商品置顶/取消置顶
 * @returns
 */
export const goodsTop = (obj) => {
  return request({
    url: "api/wechat/Supplier_GoodsTop",
    data: obj,
    method: "POST",
  });
};

/**
 * 类别置顶
 * @param {*} obj
 */
export const typeTop = (obj) => {
  return request({
    url: "api/wechat/Supplier_TypeTop",
    data: obj,
    method: "POST",
  });
};

/**
 * 删除类别
 * @param {*} obj
 */
export const deleteType = (obj) => {
  return request({
    url: "api/wechat/Supplier_DeleteType",
    data: obj,
    method: "POST",
  });
};

/**
 * 编辑类别
 * @param {*} obj
 */
export const editType = (obj) => {
  return request({
    url: "api/wechat/Supplier_EditType",
    data: obj,
    method: "POST",
  });
};

/**
 * 设置活动商品
 * @param {*} obj
 * @returns
 */
export const promoteGoods = (obj) => {
  return request({
    url: "api/wechat/Supplier_PromoteGoods",
    data: obj,
    method: "POST",
  });
};

/**
 * 取消活动商品
 * @param {*} obj
 * @returns
 */
export const cancelPromoteGoods = (obj) => {
  return request({
    url: "api/wechat/Supplier_CancelPromoteGoods",
    data: obj,
    method: "POST",
  });
};


/**
 * 修改商品类型
 * @param {*} obj 
 * @returns 
 */
export const updateGoodsType = (obj) => {
  return request({
    url: "api/wechat/Supplier_UpdateGoodsType",
    data: obj,
    method: "POST",
  });
}

/**
 * 删除商品
 */
export const deleteGoods = (obj) => {

  return request({
    url: "api/wechat/Supplier_DeleteGoods",
    data: obj,
    method: "POST",
  });
}